home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
BASIC
/
0006.ZIP
/
SCROLL.DOC
< prev
next >
Wrap
Text File
|
1983-03-26
|
5KB
|
130 lines
.FO SCROLL.DOC #
E
SCROLL.BLD (CONVERT WITH SCROLL.BAS TO SCROLL.BLD)
==================================================
THIS IS AN ASSY. LANG. SUBROUTINE TO BE USED WITH A BASIC PROGRAM TO PERFORM
SCROLLING OF THE SCREEN IN A SPECIFIED WINDOW. THE SUBROUTINE WILL SCROLL
THE CONTENTS OF THE WINDOW UP OR DOWN FILLING IN WITH A BLANK LINE OF
SPECIFIED ATTRIBUTE (I.E., BLACK, WHITE, RED, ETC...)
THE ROUTINE CAN ALSO BE USED TO CLEAR THE WINDOW
THE ARGUMENTS FOR THE CALL TO THE ROUTINE ARE:
ULR% - ROW NUMBER (1-25) OF UPPER LEFT CORNER OF WINDOW
ULC% - COL NUMBER (1-80) OF UPPER LEFT CORNER OF WINDOW
LRR% - ROW NUMBER (1-25) OF LOWER RIGHT CORNER
LRC% - COL NUMBER (1-80) OF LOWER RIGHT CORNER
ATTR% - ATTRIBUTE OF BLANKED LINE: &H07=NORMAL, &H70=REVERSE
SEE TECH. REF. MANUAL PG. 2-51 FOR OTHERS
NOTE - YOU CAN USE 0 (INSTEAD OF 7) AS THE ATTRIBUTE FOR TEXT
AND GRAPHICS MODE TO GET BLACK BACKGROUND. TRY 7
IN HI-RES GRAPHICS (SCREEN 2)...EVER SEE THAT
WHEN YOU WENT BACK TO DOS FROM GRAPHICS MODE?
LNGTH% - NUMBER OF LINES TO SCROLL (0 BLANKS ENTIRE WINDOW)
USE + NUMBER TO SCROLL UP
USE - NUMBER TO SCROLL DOWN
NOTE !! - THE ARGUMENTS ARE NOT VALUE CHECKED.
FROM BASIC: CALL SCROLL(ULR%,ULC%,LRR%,LRC%,ATTR%,LNGHT%)
PROGRAM BY: LEE M. BUCK
DATE: 3-16-83
THE PROGRAM IS LOADED USING THE BLOAD COMMAND. BELOW ARE TWO SAMPLE PROGRAMS
THAT USE THE ROUTINE. ONE USES A STRING VARIABLE WITHIN THE BASIC WORK SPACE
TO HOLD THE MACHINE LANGUAGE PROGRAM. THE OTHER RESERVES A FIXED SECTION OF
MEMORY AT THE HIGH MEMORY AREA OF YOUR MACHINE - THIS REQUIRES USE OF THE
BASIC 'CLEAR' COMMAND OR /M OPTION WHEN RUNNING BASIC IN A 64 K MACHINE
MAKE A COPY OF THIS .DOC FILE THEN EDLIN IT TO SEPARATE OUT THE TWO SAMPLE
PROGRAMS BELOW.
SAMPLE PROGRAM 1
10 'TEST PROGRAM FOR SCROLL ROUTINE
20 'USING STRING SPACE IN BASIC PROGRAM
25 ' PROGRAM BY: LEE M. BUCK -- 3/17/83
30 CLEAR 'JUST CLEARS MEMORY - MACHINE LANG. PGM. WILL BE LOCATED
35 'INSIDE BASIC WORKSPACE
40 CLS: KEY OFF
50 '
60 SCROLLPGM$=STRING$(&H39,"0") 'SET UP STRING SPACE TO HOLD PGM
70 '&H39 IS SIZE OF MACHINE CODE PGM
80 DEF SEG=VARPTR(SCROLLPGM$) 'GET THE SEGMENT LOCATIONè90 BLOAD "SCROLL.BLD",0 'LOAD INTO STRING (BE SURE TO INCLUDE 0 OFFSET)
100 '
110 ' FILL THE SCREEN WITH SOMETHING
120 FOR ROW=1 TO 22
130 FOR COL=1 TO 79
140 PRINT CHR$(ROW+64);
150 NEXT COL
160 PRINT
170 NEXT ROW
180 'PROMPT FOR SUBROUTINE ARGUMENTS
190 BEEP
200 LOCATE 23,1
210 INPUT "ULR,ULC,LRR,LRC,ATR,LEN";ULR%,ULC%,LRR%,LRC%,ATTR%,LNGTH%
220 '
230 DEF SEG=VARPTR(SCROLLPGM$) 'BE SURE SEGMENT IS SET TO STRING SPACE
240 SCROLL=0 'SET THE OFFSET TO ZERO AND CALL THE PGM
250 CALL SCROLL(ULR%,ULC%,LRR%,LRC%,ATTR%,LNGTH%)
260 '
270 SOUND 500,5: SOUND 700,5: SOUND 1000,5
280 LOCATE 13,25: PRINT "SUCCESS !!"
290 'PRESS 'ENTER' TO DO IT AGAIN; 'Esc' TO QUIT
300 DEF SEG : POKE 106,0
310 Q$=INKEY$ : IF Q$="" GOTO 310
320 IF Q$=CHR$(13) THEN 190 'DO IT AGAIN WITH 'CARRIAGE RETURN' KEY PRESS
330 IF Q$<>CHR$(27) THEN 300 'KEEP WAITING UNTILL 'Esc' KEY PRESS
340 END
SAMPLE PROGRAM 2
10 'TEST PROGRAM FOR SCROLL ROUTINE
20 'PROGRAM BY: LEE M. BUCK -- 3/17/83
30 'PUT THE ROUTINE AS HIGH AS POSSIBLE IN MEMORY
40 'IF TOTAL MEMORY IS 64K OR LESS SPACE MUST BE RESERVED WITHIN BASIC WORK
50 'AREA. RESERVE SPACE USING THE 'CLEAR' COMMAND AT THE BEGINNING OF PGM.
60 'OR USE THE /M OPTION WHEN STARTING BASIC(A). (SEE THE BASIC MANUAL)
70 CLS: KEY OFF
80 ' PUT SOMETHING ON THE SCREEN
90 FOR ROW=1 TO 22
100 FOR COL=1 TO 79
110 PRINT CHR$(ROW+64);
120 NEXT COL
130 PRINT
140 NEXT ROW
150 '
160 'CALCULATE THE SEGMENT REQUIRED TO PUT ROUTINE AT HIGH MEMORY LOCATION
170 '
180 PGM.SIZE=&H39 'SIZE OF MACHINE LANGUAGE PROGRAM
190 MEM.SIZE=160 'TOTAL K's OF MACHINE MEMORY (LESS RAMDISK MEMORY)
200 SEGMENT=MEM.SIZE*64-CINT(PGM.SIZE/16)
210 '
220 DEF SEG=SEGMENT 'SET SEGMENT AT HIGH MEMORY LOCATION
230 '
240 'LOAD THE SUBROUTINE INTO MEMORY. IT ONLY NEEDS TO BE DONE ONCE.è250 BLOAD "SCROLL.BLD",0 'BE SURE TO SET THE OFFSET TO ZERO
260 '
270 'GET THE SUBROUTINE PARAMETERS
280 BEEP
290 LOCATE 23,1
300 INPUT "ULR,ULC,LRR,LRC,ATR,LEN";ULR%,ULC%,LRR%,LRC%,ATTR%,LNGTH%
310 '
320 ' CALL THE SUBROUTINE
330 DEF SEG=SEGMENT 'MAKE SURE SEGMENT IS SET
340 SCROLL=0 'SET THE OFFSET
350 CALL SCROLL(ULR%,ULC%,LRR%,LRC%,ATTR%,LNGTH%)
360 '
370 SOUND 500,5: SOUND 700,5: SOUND 1000,5
380 LOCATE 12,25: PRINT " SUCCESS !! "
390 'PRESS 'ENTER' TO DO IT AGAIN; 'Esc' TO QUIT
400 DEF SEG : POKE 106,0
410 Q$=INKEY$ : IF Q$="" GOTO 410
420 IF Q$=CHR$(13) THEN 280 'DO IT AGAIN WITH 'CARRIAGE RETURN' KEY PRESS
430 IF Q$<>CHR$(27) THEN 400 'KEEP WAITING UNTILL 'Esc' KEY PRESS
440 END
N